import { attrDefine } from "../../../../../defines/attr_define";
import { elementDefine } from "../../../../../defines/element_define";
import { EquipTypeDefine } from "../../../../../defines/equip_define";
import { GoodLevelDefine, GoodTypeDefine } from "../../../../../defines/good_type";
import { MoneyDefine } from "../../../../../defines/money_define";
import { LimbsTypeDefine } from "../../../../../defines/people_limbs";
import { humanRace } from "../../../../../defines/race_define";
import { EquipStorageComponent } from "../../../../goods-control/components/equip_storage";
import { EquipGoods } from "../../../../goods-control/equip_goods";
import { WeaponGood } from "../../../../goods-control/weapon_good";
import inventory from "./inventory";

export default class GoodNode extends EquipGoods {
	constructor(...params) {
		super(...params);
	}

	getTitle() {
		return "储物袋";
	}

	getDesc() {
		return "内藏洞天，可储物。";
	}

	getType(){
		return GoodTypeDefine.ornaments.key
	}

	getLevel(){
		return GoodLevelDefine.level2.key;
	}
  
	getEquipZIndex(){
		return EquipTypeDefine.pendant.key;
	}

	getZIndexIsCoexist(){
		return true;
	}

	getIsEquip() {
		return [
			LimbsTypeDefine.body
		];
	}

	getNeedAttr(){
		return {
			[attrDefine.mana.key]: 1
		}
	}

	getDefaultAttr() {
		let num = this.attr.data[GoodLevelDefine.grade.key] * 100 || 100;
		return {
			[attrDefine.weight.key]: 1,
			[attrDefine.inventoryWeight.key]: num
		};
	}

	getDefaultData(){
		return {
			[GoodLevelDefine.grade.key]: 1
		}
	}

  getSpecialInfo(){
    let attr = this.getAttr();
    return '装备后，可为背包增加' + attr[attrDefine.inventoryWeight.key] + 'kg空间';
  }

	getDefaultInventory(){
		return inventory;
	}

	getComponents(){
		return [EquipStorageComponent]
	}

	getPrice(){
		return {
			type: MoneyDefine.stone.key,
			price: 100
		}
	}
}